feat(ci): replace pre-commit into prek#17703
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| exclude: 'node_modules' | ||
| types: [text] | ||
| args: ['--write'] | ||
| - id: eslint | ||
| entry: node_modules/.bin/eslint | ||
| name: eslint | ||
| description: This hook runs eslint on JavaScript and TypeScript files | ||
| entry: eslint | ||
| language: node | ||
| files: '\.[jt]sx?$' | ||
| exclude: 'node_modules' | ||
| types: [text] |
There was a problem hiding this comment.
Bug: The local prettier and eslint hooks use language: node without additional_dependencies, which will cause them to fail with 'executable not found' errors during commits.
Severity: MEDIUM
Suggested Fix
To fix this, either change the language to language: system and point the entry to the project's local node_modules/.bin executables, or add additional_dependencies: [prettier, eslint] to the hook definitions to ensure the tools are installed in the isolated hook environment.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: .pre-commit-config.yaml#L28-L44
Potential issue: The `pre-commit` configuration for the local `prettier` and `eslint`
hooks specifies `language: node`. This creates an isolated, empty Node.js environment
for the hooks. Because `additional_dependencies` are not provided, the `prettier` and
`eslint` packages will not be installed into this environment. As a result, when a
developer attempts to commit a file that triggers these hooks, the `pre-commit`
framework will be unable to find the `prettier` or `eslint` executables, causing the
hook to fail and blocking the commit.
Did we get this right? 👍 / 👎 to inform future reviews.
sfanahata
left a comment
There was a problem hiding this comment.
Looks good! Also seems like that sentry bot potential bug is a false positive.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bbf8b56. Configure here.
| description: This hook runs Prettier on JavaScript and TypeScript files | ||
| entry: prettier | ||
| language: node | ||
| files: '\.[jt]sx?$' |
There was a problem hiding this comment.
Prettier hook file pattern excludes markdown and mjs
Medium Severity
The new prettier hook's files pattern '\.[jt]sx?$' only matches .js, .jsx, .ts, and .tsx files. However, the project's CI lint command (lint:prettier in package.json) checks {md,mdx,ts,tsx,js,jsx,mjs} files, and prettier.config.js has explicit overrides for *.md and *.mdx. This means the pre-commit hook will no longer catch formatting issues in markdown, MDX, or .mjs files before commit — developers will only learn about them when CI fails.
Reviewed by Cursor Bugbot for commit bbf8b56. Configure here.


DESCRIBE YOUR PR
Faster execution than
pre-commit. Thesentryandself-hostedrepo are already using it right now.IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes:
LEGAL BOILERPLATE
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
EXTRA RESOURCES